const { join } = require('path')
const { copySync, removeSync } = require('fs-extra')

console.log('copy docs/.vuepress/dist to dist')

const distPath = join(__dirname, '../docs/.vuepress/dist')
let targetPath = join(__dirname, '../dist')

const getArguments = process.argv.splice(2) || ''
const arg = String(getArguments)

if (arg) {
  targetPath = join(__dirname, arg)
}

// -----------------------------

// const SourceCodePath = join(__dirname, '../source-code')
// const DemoPath = join(__dirname, '../demo')
// const VuejsPath = join(__dirname, '../js/vue.js')


function ctd() {
  removeSync(targetPath)
  copySync(distPath, targetPath)

  // copySync(SourceCodePath, join(targetPath, './src'))
  // copySync(DemoPath, join(targetPath, './demo'))
  // copySync(VuejsPath, join(targetPath, './vue.js'))
}

module.exports = ctd